﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.NpoiHelper.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class NpoiAttribute: Attribute
    {
        /// <summary>
        /// 映射的字段名称
        /// </summary>
        public string HeaderName;
        /// <summary>
        /// 表格宽度
        /// </summary>
        public int ColumnWidth;
        /// <summary>
        /// 字段位置（越大越靠下,默认999）
        /// </summary>
        public int Position=999;
        /// <summary>
        /// 表头生效条件(默认导入导出都生效,表头生效指读取时读取这列,导出时生成这列)
        /// </summary>
        public OperationType OperationType = OperationType.Import_Export;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ColumnMapperName">映射表头名称</param>
        public NpoiAttribute(string HeaderName,int ColumnWidth=0,int Position=999, OperationType OperationType= OperationType.Import_Export)
        {
            this.HeaderName = HeaderName;
            this.ColumnWidth = ColumnWidth;
            this.Position = Position;
            this.OperationType = OperationType;
        }
    }
}
